﻿using LogManagement;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Services
{
    public class BaseService : MarshalByRefObject
    {
        public static Domain.Entities.ResultModel<T> CreateResultEntry<T>()
        {
            return new Domain.Entities.ResultModel<T>()
            {
                IsSucess = true,
                Message = string.Empty,
                CallbackMethod = string.Empty,
                Data = default(T)
            };
        }

        private static byte[] paramByte = null;

        public static byte[] ParamByte
        {
            get { return BaseService.paramByte; }
            set
            {
                try
                {
                    BaseService.paramByte = value;
                }
                catch (Exception ex)
                {
                    Log4netHelper.LogInfo(LogManagement.Log4netType.Error, "", string.Format("Message:{0},InnerException:{1}", ex.Message, ex.InnerException == null ? "" : ex.InnerException.Message), ex);
                    throw ex;
                }
            }
        }

        protected readonly Services.Operation.IOperationServices _OperationServices = new Services.Operation.OperationServices();
    }
}